{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fnil\fcharset77 Monaco;\f2\fswiss\fcharset77 Helvetica;
}
{\colortbl;\red255\green255\blue255;\red191\green0\blue0;\red0\green0\blue191;\red0\green115\blue0;
\red96\green96\blue96;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs36 \cf0 SVF - 12db/Oct State Variable Filter
\f1\b0\fs18 \
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs24 \cf0 SVF.ar(in, cutoff, res, low, band, high, notch, peak)\

\f2\b0 params:\
	
\f0\b in
\f2\b0  - audio in\
	
\f0\b cutoff
\f2\b0   - cutoff frequency.\
	
\f0\b res
\f2\b0  - resonance. 0.0 - 1.0\
	
\f0\b low
\f2\b0  - lowpass filter output level. 0.0 - 1.0\
	
\f0\b band
\f2\b0  - bandpass filter output level. 0.0 - 1.0\
	
\f0\b high
\f2\b0  - high filter output level. 0.0 - 1.0\
	
\f0\b notch
\f2\b0  - notchfilter output level. 0.0 - 1.0\
	
\f0\b peak
\f2\b0  - peak filter output level. 0.0 - 1.0\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\fs18 \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f2\fs24 \cf0 Total, 100% Plastic...\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f1\fs18 \cf0 	\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\cf2 // examples\cf0 \
s.boot;\
(\
z = \cf3 SynthDef\cf0 (\cf4 \\svf_test\cf0 , \{ \cf3 arg\cf0  low=0.1, band=0.0, high=0.0, notch=0.0, peak=0.0;\
	\cf3 var\cf0  sig;\
\
	sig = \cf3 SVF\cf0 .ar(\
		\cf3 LFSaw\cf0 .ar(\cf3 LFSaw\cf0 .kr(2).range(110,35)),	\cf2 // signal\cf0 \
		\cf3 MouseX\cf0 .kr(20,20000,\cf4 'exponential'\cf0 ),	\cf2 // cutoff\cf0 \
		\cf3 MouseY\cf0 .kr(1.0,0,\cf4 'linear'\cf0 ),			\cf2 // q\cf0 \
		low, band, high, notch, peak);		\cf2 // levels\cf0 \
	\cf3 Out\cf0 .ar(0, sig ! 2);\
\}).play(addAction: \cf4 \\addToTail\cf0 );\
)\
\
z.set(\cf4 \\low\cf0 , 0.1);\
z.set(\cf4 \\band\cf0 , 0.0);\
z.set(\cf4 \\high\cf0 , 0.0);\
z.set(\cf4 \\notch\cf0 , 0.0);\
z.set(\cf4 \\peak\cf0 , 0.0);\
\
\cf2 // a small gui\cf0 \
(\
k= [];\
[\cf4 \\low\cf0 , \cf4 \\band\cf0 , \cf4 \\high\cf0 , \cf4 \\notch\cf0 , \cf4 \\peak\cf0 ].do(\{ \cf3 arg\cf0  j; \
	k = k.add(\cf3 KnobEditor\cf0 .new(0.0, \cf4 \\amp\cf0 ).action_(\{ \cf3 arg\cf0  v; z.set(j, v.value) \}) )\
 \});\
)\
\
(\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\cf3 Sheet\cf0 (\{ \cf3 arg\cf0  lay;\
	[\cf4 \\low\cf0 , \cf4 \\band\cf0 , \cf4 \\high\cf0 , \cf4 \\notch\cf0 , \cf4 \\peak\cf0 ].do(\{ \cf3 arg\cf0  j; \cf3 CXLabel\cf0 .new(lay, j, minWidth: 44) \});\
	lay.startRow;\
	k.do(\cf3 _\cf0 .gui(lay));\
\}, \cf5 "SVF"\cf0 )\
)\
\
z.free\
\
(\
\cf3 Patch\cf0 (\{ \cf3 arg\cf0  in, ffreq=1200.0, res=0.5, low=0.25, band=0.0, high=0.0, notch=0.0, peak=0.0;\
	\
	\cf3 SVF\cf0 .ar(\
		\cf3 LFSaw\cf0 .ar(\cf3 LFSaw\cf0 .kr(2).range(110,55), 0.0, 0.1), \
		ffreq, res, low, band, high, notch, peak);\
\
\}).gui\
)\
\
(\
\cf3 Patch\cf0 (\{ arg low=0.25, band=0.0, high=0.0, notch=0.0, peak=0.0;\
	\cf3 var\cf0  sig, freq;\
	freq = \cf3 MouseX\cf0 .kr(20,12000,\cf4 \\exponential\cf0 );\
	sig = \cf3 SVF\cf0 .ar(\
		\cf3 LFSaw\cf0 .ar([freq * 0.99, freq * 1.01], 0, 0.1) ! 2,\
		\cf3 SinOsc\cf0 .kr(\cf3 SinOsc\cf0 .kr(0.1),1.5pi,1550,1800),\
		\cf3 MouseY\cf0 .kr(1,0,\cf4 \\linear\cf0 ),\
		low, band, high, notch, peak);\
	 (\cf3 CombN\cf0 .ar(sig, 0.4, [0.4,0.35],2) * 0.4) + (sig * 0.5);\
\}).gui\
)\
\
}